package com.mdp.workflow.cfg;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * bpm 模块的 web 组件的 Configuration
 *
 *@author 唛盟开源9哥
 */
@Configuration(proxyBeanMethods = false)
public class FlowWebConfiguration {

    /**
     * 配置 Flowable Web 过滤器
     */
    @Bean
    public FilterRegistrationBean<FlowWebFilter> flowableWebFilter() {
        FilterRegistrationBean<FlowWebFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new FlowWebFilter());
        registrationBean.setOrder(-98);//必须在spring secrity之后执行，否则拿不到用户数据
        return registrationBean;
    }

}
